package com.yun.zf.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.zf.common.admin.model.customer.CustomerAgentInfoMo;
import com.yun.zf.common.app.domain.ZfCustomerAgent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 客户授权业务员表 Mapper 接口
 * </p>
 *
 * @author cj
 * @since 2021-03-30
 */
@Mapper
public interface ZfCustomerAgentMapper extends BaseMapper<ZfCustomerAgent> {


    @Select("<script>" +
            " SELECT name , iphone ,agent_no from sys_agent WHERE agent_no in (  " +
            "  SELECT ca.agent_no from zf_customer_agent  ca  WHERE  reference=-1 and  customer_id=#{customerId} and city_code=#{cityCode} and province_code=#{proCode} ) " +
            "</script>")
    public List<CustomerAgentInfoMo> getAgentInfo(Long proCode, Long cityCode, Long customerId);




}
